package com.ruoyi.project.remoteControl.controller;

import com.ruoyi.framework.web.domain.AjaxResult;
import com.ruoyi.project.remoteControl.domain.Option;
import com.ruoyi.project.remoteControl.service.OptionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 从V_REMOTE_COMPUTER_STATUS查询deviceName和deviceClientId，生成option列表对象用于前端查询的下拉菜单候选
 */
@RestController
@RequestMapping("/option")
public class OptionController {
    @Autowired
    OptionService optionService;

    /**
     * 获取拖轮信息并封装成Option对象列表
     * @return
     */
    @GetMapping("/getTugboatOption")
    public AjaxResult getTugboatOption(){
        List<Option> deviceOption = optionService.getTugboatOption();
        System.out.println(deviceOption);
        return AjaxResult.success(deviceOption);
    }
}
